<?php

$arr=[
    ["id"=>1],
    ["id"=>2],
    ["id"=>3],
];

foreach ($arr as $key => $value) {
    $arr[$key]['pic']=['src'=>'~~~~'.$key];
}

foreach ($arr as $key => &$value) {
    $value['pic']=['src'=>'~~~1~'];
}

unset($value);

var_dump($arr);
